﻿using Framework.Command;
using Framework.Config;
using Framework.Event;
using Framework.Infrastructure;
using Framework.Message;
using Framework.Message.Impl;
using Framework.MessageQueue.ZeroMQ;
using Sample.Command;
using Sample.DomainEvent.Community;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace EventSubscriberHost
{
    class Program
    {
        static void Main(string[] args)
        {
            //IoCFactory.Resolve<IEventPublisher>();
            //IoCFactory.Resolve<IMessageConsumer>("DomainEventConsumer").StartConsuming();


            var commandHandlerProvider = IoCFactory.Resolve<ICommandHandlerProvider>();
            var commandConsumer = new CommandConsumer(commandHandlerProvider,
                                                       "inproc://ReplyReceiver",
                                                       "inproc://CommandConsumer1");

            commandConsumer.StartConsuming();

            while (true)
            {
                Thread.Sleep(5000);
                Console.WriteLine(commandConsumer.GetStatus());
            }

        }
   
    }
}
